{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>产品列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->           
           <div class="row">
                <div class="col-sm-12">   
                <div  class="col-sm-2" style="width: 100px">
                    <div class="input-group" >  
                        <a href="{:url('add_type')}"><button class="btn btn-outline btn-primary" type="button">添加分类</button></a> 
                    </div>
                </div>                                             
                </div>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th width="4%">ID</th>
                                <th width="9%">分类名称</th>
                                <th width="9%">添加时间</th>
                                <th width="9%">排序</th>
                                <th width="10%">操作</th>
                            </tr>
						</thead>
						<tbody>
                        	{volist name="list" id='ad'}
                        	<tr class="long-td">
                        		<td>{$ad.id}</td>
                        		<td>{$ad.typename}</td>
                        		<td>{$ad.add_time}</td>
                        		<td>{$ad.orderby}</td>
                        		<td><a href="{:url('edit_type',['id'=>$ad.id])}" class="btn btn-primary btn-xs btn-outline">
                                            <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
                                        <a href="JavaScript:del({$ad.id});" class="btn btn-danger btn-xs btn-outline">
                                            <i class="fa fa-trash-o"></i> 删除</a></td>
                        	</tr>
                        	{/volist}
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

<!-- 加载动画 -->

{include file="public/footer" /}
<script type="text/javascript" src="__JS__/jquery.min.js"></script>
<script type="text/javascript">
 
 
     function del(id){
     	$.ajax({
					url: 'delete',
					data: {
						id:id
					},
					success: function(data) {
						layer.msg(data, {icon: 5,time:1500,shade: 0.1});
						window.location.href="{:url('goods/goodstype')}";
					}
				})
     }
</script>
</body>
</html>